package com.sc.nft.controller;

import com.sc.nft.feign.WxMiniClient;
import com.sc.nft.feign.WxMiniHomeClient;
import com.sc.nft.req.wxmini.GetQrCodeReq;
import com.sc.nft.sup.Result;
import com.sc.nft.vo.home.HomePageDetailsVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

@Slf4j
@RequiredArgsConstructor
@RestController
@RequestMapping("/ipMall/wxMiniMall/service")
@Api(tags = "小程序服务接口")
public class WxMiniController {

    private final WxMiniClient wxMiniClient;

    /**
     * 获取小程序二维码
     * @return
     */
    @PostMapping(value = "/getQrCode", produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "获取小程序二维码")
    public Result get(@Valid @RequestBody GetQrCodeReq request) {
        return wxMiniClient.getQrCode(request);
    }

}